﻿using System.ComponentModel.DataAnnotations;

namespace Inovout.Data.Domain
{
    public class SelectAttribute : UIHintAttribute
    {
        public SelectAttribute(SelectType selectType, string textProperty, string valueProperty = "Id")
            : base(selectType.ToString())
        {
            this.SelectType = selectType;
            this.TextProperty = textProperty;
            this.ValueProperty = valueProperty;
        }
        public string[] TextValueProperties { get { return new string[] { ValueProperty, TextProperty }; } }
        public SelectType SelectType { get; private set; }
        public string TextProperty { get; private set; }
        public string ValueProperty { get; private set; }
    }
    public enum SelectType
    {
        DropDownList,
        CheckBoxList,
        RadioButtonList,
        ComboTree,
    }
}
